package com.usian.feign;

import com.usian.AdNode;
import com.usian.PageResult;
import com.usian.pojo.TbContent;
import com.usian.pojo.TbContentCategory;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "usian-content-service")
public interface ContentFeign {

//    内容分类管理根据父节点查询子节点
    @RequestMapping("selectContentCategoryByParentId")
    public List<TbContentCategory> selectContentCategoryByParentId(@RequestParam Long id);

//    添加内容分类
    @RequestMapping("insertContentCategory")
    public Integer insertContentCategory(@RequestParam Long parentId,@RequestParam String name );

//    删除内容分类
    @RequestMapping("deleteContentCategoryById")
    public Integer deleteContentCategoryById(@RequestParam Long categoryId);

//    修改内容分类数据
    @RequestMapping("updateContentCategory")
    public Integer updateContentCategory(@RequestParam Long id,@RequestParam String name);

//    根据分类id查询内容列表
    @RequestMapping("selectTbContentAllByCategoryId")
    public PageResult selectTbContentAllByCategoryId(@RequestParam Long categoryId,
                                                     @RequestParam Integer page,
                                                     @RequestParam Integer rows);

//    增加分类内容
    @RequestMapping("insertTbContent")
    public Integer insertTbContent(@RequestBody TbContent tbContent);

//    删除分类内容
    @RequestMapping("deleteContentByIds")
    public Integer deleteContentByIds(@RequestParam Long ids);

//    查询首页大广告位
    @RequestMapping("selectFrontendContentByAD")
    public List<AdNode> selectFrontendContentByAD();
}
